package cn.faster.common.enums;

public enum ShiroEnum {
    // 不要随便改里面的值
    XIAO_HASHALGORITHM(1, "md5"),
    XIAO_HASHITERATIONS(2, 1024),
    XIAO_SYS_USER_MENU_CACHE(3,"sys_menu_cache");

    private Integer key;
    private Object value;

    ShiroEnum(Integer key, Object value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public Object getValue() {
        return value;
    }

    /* *
     * @description: 通过key来找到对应的value
     * @author xiaoCoder
     * @date: 2021/8/11 16:33
     * @param: [integer]
     * @return: java.lang.Object
     */
    public Object getKeyValue(Integer integer) {
        for (ShiroEnum shiroEnum : ShiroEnum.values()) {
            if (shiroEnum.getKey().equals(integer)) {
                return shiroEnum.getValue();
            }
        }
        return null;
    }
}
